<template>
	<div class="user-address-item">
		<div>
			<circle-radio :label="addressItem.id" v-model="defaultAddress"/>
		</div>
		<div class="user-address-item-info">
			<div class="user-address-item-info-title">
				<span>{{addressItem.linkMan}}</span>&nbsp;
				<span>{{addressItem.mobile}}</span>
			</div>
			<div>
				<span>{{addressItem.address}}</span>
			</div>
		</div>
		<router-link tag="div" :to="'/update_address/'+addressItem.id">
			<span class="iconfont icon-update"></span>
		</router-link>
	</div>
</template>

<script>
	import CircleRadio from '#/Public/CircleRadio';

	export default {
		name: "addressItem",
		props: {
			addressItem: {
				type: Object,
				required: true
			},
			isDefault: {
				type: Number
			}
		},
		computed: {
			defaultAddress: {
				get() {
					return this.isDefault;
				},
				set(value) {
					this.$emit('isDefaultUpdate', value);
				}
			}
		},
		components: {
			CircleRadio
		}
	}
</script>
